package models;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "LABORATORIO", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Laboratorio.findAll", query = "SELECT l FROM Laboratorio l"),
    @NamedQuery(name = "Laboratorio.findByIdLaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.idLaboratorio = :idLaboratorio"),
    @NamedQuery(name = "Laboratorio.findByCapacidadlab", query = "SELECT l FROM Laboratorio l WHERE l.capacidadlab = :capacidadlab"),
    @NamedQuery(name = "Laboratorio.findByNombrelab", query = "SELECT l FROM Laboratorio l WHERE l.nombrelab = :nombrelab"),
    @NamedQuery(name = "Laboratorio.findByDescripcionlab", query = "SELECT l FROM Laboratorio l WHERE l.descripcionlab = :descripcionlab"),
    @NamedQuery(name = "Laboratorio.findByDisponiblelab", query = "SELECT l FROM Laboratorio l WHERE l.disponiblelab = :disponiblelab")})
public class Laboratorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idLaboratorio", nullable = false)
    private Integer idLaboratorio;
    @Column(name = "capacidadlab")
    private Integer capacidadlab;
    @Column(name = "nombrelab", length = 45)
    private String nombrelab;
    @Column(name = "descripcionlab", length = 100)
    private String descripcionlab;
    @Basic(optional = false)
    @Column(name = "disponiblelab", nullable = false, length = 45)
    private String disponiblelab;
    @OneToMany(mappedBy = "laboratorioId")
    private List<Asignatura> asignaturaList;

    public Laboratorio() {
    }

    public Laboratorio(Integer idLaboratorio) {
        this.idLaboratorio = idLaboratorio;
    }

    public Laboratorio(Integer idLaboratorio, String disponiblelab) {
        this.idLaboratorio = idLaboratorio;
        this.disponiblelab = disponiblelab;
    }

    public Integer getIdLaboratorio() {
        return idLaboratorio;
    }

    public void setIdLaboratorio(Integer idLaboratorio) {
        this.idLaboratorio = idLaboratorio;
    }

    public Integer getCapacidadlab() {
        return capacidadlab;
    }

    public void setCapacidadlab(Integer capacidadlab) {
        this.capacidadlab = capacidadlab;
    }

    public String getNombrelab() {
        return nombrelab;
    }

    public void setNombrelab(String nombrelab) {
        this.nombrelab = nombrelab;
    }

    public String getDescripcionlab() {
        return descripcionlab;
    }

    public void setDescripcionlab(String descripcionlab) {
        this.descripcionlab = descripcionlab;
    }

    public String getDisponiblelab() {
        return disponiblelab;
    }

    public void setDisponiblelab(String disponiblelab) {
        this.disponiblelab = disponiblelab;
    }

    public List<Asignatura> getAsignaturaList() {
        return asignaturaList;
    }

    public void setAsignaturaList(List<Asignatura> asignaturaList) {
        this.asignaturaList = asignaturaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLaboratorio != null ? idLaboratorio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Laboratorio)) {
            return false;
        }
        Laboratorio other = (Laboratorio) object;
        if ((this.idLaboratorio == null && other.idLaboratorio != null) || (this.idLaboratorio != null && !this.idLaboratorio.equals(other.idLaboratorio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Laboratorio[idLaboratorio=" + idLaboratorio + "]";
    }

}
